Bi-directional data transfer within a single I/O operation

ABSTRACT

A computer program product, apparatus, and a method for facilitating input/output (I/O) processing for an I/O operation at a host computer system configured for communication with a control unit. The method includes receiving, by a control unit, a command block configured to hold a plurality of commands including an input command and/or an output command, the plurality of commands specified by a transport command word (TCW) including a read indicator configured to indicate whether the I/O operation includes input data and a write indictor configured to indicate whether the I/O operation includes output data; based on the command block holding at least one output command, receiving the output data and executing the at least one output command; and based on the command block holding at least one input command, forwarding the input data to the channel subsystem for storage at a location specified by the TCW.

DOMESTIC PRIORITY

This application is a continuation of U.S. patent application Ser. No.13/917,280, filed Jun. 13, 2013, which is a continuation of U.S. patentapplication Ser. No. 13/075,993, filed Mar. 30, 2011, now U.S. Pat. No.8,495,253, which is a continuation of U.S. patent application Ser. No.12/030,954, now U.S. Pat. No. 7,941,570, filed Feb. 14, 2008, thedisclosures of which are incorporated by reference herein in theirentirety.

BACKGROUND Field of the Invention

The present disclosure relates generally to input/output (I/O)processing, and in particular, to providing an I/O operation thatincludes both input and output data.

Input/output (I/O) operations are used to transfer data between memoryand I/O devices of an I/O processing system. Specifically, data iswritten from memory to one or more I/O devices, and data is read fromone or more I/O devices to memory by executing I/O operations.

To facilitate processing of I/O operations, an I/O subsystem of the I/Oprocessing system is employed. The I/O subsystem is coupled to mainmemory and the I/O devices of the I/O processing system and directs theflow of information between memory and the I/O devices. One example ofan I/O subsystem is a channel subsystem. The channel subsystem useschannel paths as communications media. Each channel path includes achannel coupled to a control unit, the control unit being furthercoupled to one or more I/O devices.

The channel subsystem may employ channel command words (CCWs) totransfer data between the I/O devices and memory. A CCW specifies thecommand to be executed. For commands initiating certain I/O operations,the CCW designates the memory area associated with the operation, theaction to be taken whenever a transfer to or from the area is completed,and other options.

During I/O processing, a list of CCWs is fetched from memory by achannel. The channel parses each command from the list of CCWs andforwards a number of the commands, each command in its own entity, to acontrol unit coupled to the channel. The control unit then processes thecommands. The channel tracks the state of each command and controls whenthe next set of commands are to be sent to the control unit forprocessing. The channel ensures that each command is sent to the controlunit in its own entity. Further, the channel infers certain informationassociated with processing the response from the control unit for eachcommand.

Performing I/O processing on a per CCW basis may involve a large amountof processing overhead for the channel subsystem, as the channels parseCCWs, track state information, and react to responses from the controlunits. Therefore, it may be beneficial to shift much of the processingburden associated with interpreting and managing CCW and stateinformation from the channel subsystem to the control units. Simplifyingthe role of channels in communicating between the control units and anoperating system in the I/O processing system may increase communicationthroughput as less handshaking is performed. Simplifying the role ofchannels in communication may include grouping multiple commands into asingle I/O operation. However, altering command sequences by groupingtwo or more commands together in a single I/O operation may result inthe I/O operation having both input data and output data. Currently, anI/O operation can support a single data area that may be utilized fordata input or data output, but not both within the same I/O operation.This limits the kinds of commands that can be grouped together in asingle I/O operation and thus, limits the increase in throughput thatcan be gained by grouping commands. Accordingly, there is a need in theart to be able to transfer both input data and output data within asingle I/O operation.

BRIEF SUMMARY

An exemplary embodiment includes a computer program product forfacilitating input/output (I/O) processing for an I/O operation at acontrol unit coupled to an I/O device. The control unit is configuredfor communication with a host computer system including a memoryassociated with an operating system, the host computer system includinga channel subsystem. The computer program product includes anon-transitory tangible storage medium readable by a processing circuitand storing instructions for execution by the processing circuit forperforming a method including: receiving, by the control unit, a commandblock transmitted from the channel subsystem as a single entityconfigured to hold a plurality of commands, the plurality of commandsincluding at least one of an input command and an output command, theplurality of commands specified by a transport command word (TCW)obtained by the channel subsystem and associated with the I/O operation,the TCW specifying at least one of a location in the memory of outputdata and a location in the memory for storing input data, the TCWincluding a read indicator configured to indicate whether the I/Ooperation includes input data and a write indictor configured toindicate whether the I/O operation includes output data; based on thecommand block holding at least one output command, receiving the outputdata specified by the TCW and executing the at least one output command;and based on the command block holding at least one input command,forwarding the input data specified by the TCW to the channel subsystemfor storage at a location specified by the TCW.

Another exemplary embodiment includes an apparatus for providingbi-directional data transfer within a single input/output (I/O)operation. The apparatus includes: a control unit coupled to an I/Odevice, the control unit configured for communication with a hostcomputer system including a memory associated with an operating system,the host computer system including a channel subsystem configured tocommunicate with the control unit. The control unit is configured toperform a method including: receiving a command block transmitted fromthe channel subsystem as a single entity configured to hold a pluralityof commands, the plurality of commands including at least one of aninput command and an output command, the plurality of commands specifiedby a transport command word (TCW) obtained by the channel subsystem andassociated with the I/O operation, the TCW specifying at least one of alocation in the memory of output data and a location in the memory forstoring input data, the TCW including a read indicator configured toindicate whether the I/O operation includes input data and a writeindictor configured to indicate whether the I/O operation includesoutput data; based on the command block holding at least one outputcommand, receiving the output data specified by the TCW and executingthe at least one output command; and based on the command block holdingat least one input command, forwarding the input data specified by theTCW to the channel subsystem for storage at a location specified by theTCW.

A further exemplary embodiment includes a method of facilitatinginput/output (I/O) processing for an I/O operation at a control unitcoupled to an I/O device, the control unit configured for communicationwith a host computer system including a memory associated with anoperating system, the host computer system including a channelsubsystem. The method includes: receiving a command block transmittedfrom the channel subsystem as a single entity configured to hold aplurality of commands, the plurality of commands including at least oneof an input command and an output command, the plurality of commandsspecified by a transport command word (TCW) obtained by the channelsubsystem and associated with the I/O operation, the TCW specifying atleast one of a location in the memory of output data and a location inthe memory for storing input data, the TCW including a read indicatorconfigured to indicate whether the I/O operation includes input data anda write indictor configured to indicate whether the I/O operationincludes output data; based on the command block holding at least oneoutput command, receiving the output data specified by the TCW andexecuting the at least one output command; and based on the commandblock holding at least one input command, forwarding the input dataspecified by the TCW to the channel subsystem for storage at a locationspecified by the TCW.

Other articles of manufacture, apparatuses, and/or methods according toembodiments will be or become apparent to one with skill in the art uponreview of the following drawings and detailed description. It isintended that all such additional articles of manufacture, apparatuses,and/or methods be included within this description, be within the scopeof the present invention, and be protected by the accompanying claims.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The subject matter which is regarded as the invention is particularlypointed out and distinctly claimed in the claims at the conclusion ofthe specification. The foregoing and other objects, features, andadvantages of the invention are apparent from the following detaileddescription taken in conjunction with the accompanying drawings inwhich:

FIG. 1 depicts one embodiment of an I/O processing system incorporatingand using one or more aspects of the present invention;

FIG. 2A depicts one example of a prior art channel command word;

FIG. 2B depicts one example of a prior art channel command word channelprogram;

FIG. 3 depicts one embodiment of a prior art link protocol used incommunicating between a channel and control unit to execute the channelcommand word channel program of FIG. 2B;

FIG. 4 depicts one embodiment of a transport control word (TCW) channelprogram, in accordance with an aspect of the present invention;

FIG. 5 depicts one embodiment of a link protocol used to communicatebetween a channel and control unit to execute the TCW channel program ofFIG. 4, in accordance with an aspect of the present invention;

FIG. 6 depicts one embodiment of a prior art link protocol used tocommunicate between a channel and control unit in order to execute fourread commands of a channel command word channel program;

FIG. 7 depicts one embodiment of a link protocol used to communicatebetween a channel and control unit to process the four read commands ofa TCW channel program, in accordance with an aspect of the presentinvention;

FIG. 8 depicts one embodiment of a control unit and a channel subsystem,in accordance with an aspect of the present invention;

FIG. 9 depicts one embodiment of a TCW in accordance with an aspect ofthe present invention;

FIG. 10 depicts one embodiment of a TCW channel program, in accordancewith an aspect of the present invention;

FIG. 11 depicts one embodiment of a link protocol used to communicatebetween a channel and control unit to execute the TCW channel program ofFIG. 10, in accordance with an aspect of the present invention;

FIG. 12 depicts one embodiment of a process for bi-directional datatransfer within a single I/O operation, in accordance with an aspect ofthe present invention; and

FIG. 13 depicts one embodiment of an article of manufactureincorporating one or more aspects of the present invention.

The detailed description explains the preferred embodiments of theinvention, together with advantages and features, by way of example withreference to the drawings.

DETAILED DESCRIPTION

In accordance with an aspect of the present invention, input/output(I/O) processing is facilitated by allowing a single I/O operation toinclude both input data and output data. Thus, each I/O operation can beutilized to transfer both an input stream and an output stream. Thisfacilitates I/O processing by reducing communications between componentsof an I/O processing system used to perform the I/O processing. Forinstance, the number of exchanges and sequences between an I/Ocommunications adapter, such as a channel, and a control unit isreduced. This is accomplished by sending a plurality of commands fromthe I/O communications adapter to the control unit as a single entityfor execution by the control unit, and by the control unit sending thedata resulting from the commands, if any, as a single entity. Theplurality of device command words (DCWs) sent as a single entity to acontrol unit may include both read and write commands.

The plurality of commands are included in a block, referred to herein asa transport command control block (TCCB), an address of which isspecified in a transport control word (TCW). The TCW is sent from anoperating system (OS) or other application to the I/O communicationsadapter, which in turn forwards the TCCB in a command message to thecontrol unit for processing. The control unit processes each of thecommands absent a tracking of status relative to those individualcommands by the I/O communications adapter. The plurality of commands isalso referred to as a channel program, which is parsed and executed onthe control unit rather than the I/O communications adapter.

In an exemplary embodiment, the TCW provides the pointers to the channelfor all of the control blocks required to execute the I/O operation. Inan exemplary embodiment, the TCW includes pointers to both an input dataaddress and an output data address. This allows data to be transferredin both directions (e.g., from a channel to a control unit and from acontrol unit to a channel) within a single I/O operation.

One example of an I/O processing system incorporating and using one ormore aspects of the present invention is described with reference toFIG. 1. I/O processing system 100 includes a host system 101, whichfurther includes for instance, a main memory 102, one or more centralprocessing units (CPUs) 104, a storage control element 106, and achannel subsystem 108. The host system 101 may be a large scalecomputing system, such as a mainframe or server. The I/O processingsystem 100 also includes one or more control units 110 and one or moreI/O devices 112, each of which is described below.

Main memory 102 stores data and programs, which can be input from I/Odevices 112. For example, the main memory 102 may include one or moreoperating systems (OSs) 103 that are executed by one or more of the CPUs104. For example, one CPU 104 can execute a Linux® operating system 103and a z/OS® operating system 103 as different virtual machine instances.The main memory 102 is directly addressable and provides for high-speedprocessing of data by the CPUs 104 and the channel subsystem 108.

CPU 104 is the controlling center of the I/O processing system 100. Itcontains sequencing and processing facilities for instruction execution,interruption action, timing functions, initial program loading, andother machine-related functions. CPU 104 is coupled to the storagecontrol element 106 via a connection 114, such as a bidirectional orunidirectional bus.

Storage control element 106 is coupled to the main memory 102 via aconnection 116, such as a bus; to CPUs 104 via connection 114; and tochannel subsystem 108 via a connection 118. Storage control element 106controls, for example, queuing and execution of requests made by one ormore of the CPU 104 and the channel subsystem 108.

In an exemplary embodiment, channel subsystem 108 provides acommunication interface between host system 101 and control units 110.Channel subsystem 108 is coupled to storage control element 106, asdescribed above, and to each of the control units 110 via a connection120, such as a serial link. Connection 120 may be implemented in anymanner known in the art, including an optical link, employingsingle-mode or multi-mode waveguides in a Fibre Channel fabric (e.g., afibre channel network). Channel subsystem 108 directs the flow ofinformation between I/O devices 112 and main memory 102. It relieves theCPUs 104 of the task of communicating directly with the I/O devices 112and permits data processing to proceed concurrently with I/O processing.The channel subsystem 108 uses one or more channel paths 122 as thecommunication links in managing the flow of information to or from I/Odevices 112. As a part of the I/O processing, channel subsystem 108 alsoperforms the path-management functions of testing for channel pathavailability, selecting an available channel path 122 and initiatingexecution of the operation with the I/O devices 112.

Each channel path 122 includes a channel 124 (channels 124 are locatedwithin the channel subsystem 108, in one example, as shown in FIG. 1),one or more control units 110 and one or more connections 120. Inanother example, it is also possible to have one or more dynamicswitches (not depicted) as part of the channel path 122. A dynamicswitch may be coupled to a channel 124 and a control unit 110 andprovides the capability of physically interconnecting any two links thatare attached to the switch. In another example, it is also possible tohave multiple systems, and therefore multiple channel subsystems (notdepicted) attached to one or more of the control units 110.

Also located within channel subsystem 108 are subchannels (not shown).One subchannel is provided for and dedicated to each I/O device 112accessible to a program through the channel subsystem 108. A subchannel(e.g., a data structure, such as a table) provides the logicalappearance of a device to the program. Each subchannel providesinformation concerning the associated I/O device 112 and its attachmentto channel subsystem 108. The subchannel also provides informationconcerning I/O operations and other functions involving the associatedI/O device 112. The subchannel is the means by which channel subsystem108 provides information about associated I/O devices 112 to CPUs 104,which obtain this information by executing I/O instructions.

Channel subsystem 108 is coupled to one or more control units 110. Eachcontrol unit 110 provides logic to operate and control one or more I/Odevices 112 and adapts, through the use of common facilities, thecharacteristics of each I/O device 112 to the link interface provided bythe channel 124. The common facilities provide for the execution of I/Ooperations, indications concerning the status of the I/O device 112 andcontrol unit 110, control of the timing of data transfers over thechannel path 122 and certain levels of I/O device 112 control.

Each control unit 110 is attached via a connection 126 (e.g., a bus) toone or more I/O devices 112. I/O devices 112 receive information orstore information in main memory 102 and/or other memory. Examples ofI/O devices 112 include card readers and punches, magnetic tape units,direct access storage devices, displays, keyboards, printers, pointingdevices, teleprocessing devices, communication controllers and sensorbased equipment, to name a few.

One or more of the above components of the I/O processing system 100 arefurther described in “IBM® z/Architecture Principles of Operation,”Publication No. SA22-7832-05, 6th Edition, April 2007; U.S. Pat. No.5,461,721 entitled “System For Transferring Data Between I/O Devices AndMain Or Expanded Storage Under Dynamic Control Of Independent IndirectAddress Words (IDAWS),” Cormier et al., issued Oct. 24, 1995; and U.S.Pat. No. 5,526,484 entitled “Method And System For Pipelining TheProcessing Of Channel Command Words,” Casper et al., issued Jun. 11,1996, each of which is hereby incorporated herein by reference in itsentirety. IBM is a registered trademark of International BusinessMachines Corporation, Armonk, N.Y., USA. Other names used herein may beregistered trademarks, trademarks or product names of InternationalBusiness Machines Corporation or other companies.

In one embodiment, to transfer data between I/O devices 112 and memory102, channel command words (CCWs) are used. A CCW specifies the commandto be executed, and includes other fields to control processing. Oneexample of a CCW is described with reference to FIG. 2A. A CCW 200includes, for example, a command code 202 specifying the command to beexecuted (e.g., read, read backward, control, sense and write); aplurality of flags 204 used to control the I/O operation; for commandsthat specify the transfer of data, a count field 206 that specifies thenumber of bytes in the storage area designated by the CCW to betransferred; and a data address 208 that points to a location in mainmemory that includes the data, when direct addressing is employed, or toa list (e.g., contiguous list) of modified indirect data address words(MIDAWs) to be processed, when modified indirect data addressing isemployed. Modified indirect addressing is further described in U.S.application Ser. No. 11/464,613, entitled “Flexibly Controlling TheTransfer Of Data Between Input/Output Devices And Memory,” Brice et al.,filed Aug. 15, 2006, which is hereby incorporated herein by reference inits entirety.

One or more CCWs arranged for sequential execution form a channelprogram, also referred to herein as a CCW channel program. The CCWchannel program is set up by, for example, an operating system, or othersoftware. The software sets up the CCWs and obtains the addresses ofmemory assigned to the channel program. An example of a CCW channelprogram is described with reference to FIG. 2B. A CCW channel program210 includes, for instance, a define extent CCW 212 that has a pointer214 to a location in memory of define extent data 216 to be used withthe define extent command. In this example, a transfer in channel (TIC)218 follows the define extent command that refers the channel program toanother area in memory (e.g., an application area) that includes one ormore other CCWs, such as a locate record 217 that has a pointer 219 tolocate record data 220, and one or more read CCWs 221. Each read CCW 220has a pointer 222 to a data area 224. The data area includes an addressto directly access the data or a list of data address words (e.g.,MIDAWs or IDAWs) to indirectly access the data. Further, CCW channelprogram 210 includes a predetermined area in the channel subsystemdefined by the device address called the subchannel for status 226resulting from execution of the CCW channel program.

The processing of a CCW channel program is described with reference toFIG. 3, as well as with reference to FIG. 2B. In particular, FIG. 3shows an example of the various exchanges and sequences that occurbetween a channel and a control unit when a CCW channel program isexecuting. The link protocol used for the communications is FICON (FibreConnectivity), in this example. Information regarding FICON is describedin “Fibre Channel Single Byte Command Code Sets-3 Mapping Protocol”(FC-SB-3), T11/Project 1357-D/Rev. 1.6, INCITS (March 2003), which ishereby incorporated herein by reference in its entirety.

Referring to FIG. 3, a channel 300 opens an exchange with a control unit302 and sends a define extent command and data associated therewith 304to control unit 302. The command is fetched from define extent CCW 212(FIG. 2B) and the data is obtained from define extent data area 216. Thechannel 300 uses TIC 218 to locate the locate record CCW and the readCCW. It fetches the locate record command 305 (FIG. 3) from the locaterecord CCW 217 (FIG. 2B) and obtains the data from locate record data220. The read command 306 (FIG. 3) is fetched from read CCW 221 (FIG.2B). Each is sent to the control unit 302.

The control unit 302 opens an exchange 308 with the channel 300, inresponse to the open exchange of the channel 300. This can occur beforeor after locate command 305 and/or read command 306. Along with the openexchange, a response (CMR) is forwarded to the channel 300. The CMRprovides an indication to the channel 300 that the control unit 302 isactive and operating.

The control unit 302 sends the requested data 310 to the channel 300.Additionally, the control unit 302 provides the status to the channel300 and closes the exchange 312. In response thereto, the channel 300stores the data, examines the status and closes the exchange 314, whichindicates to the control unit 302 that the status has been received.

The processing of the above CCW channel program to read 4 k of datarequires two exchanges to be opened and closed and seven sequences. Thetotal number of exchanges and sequences between the channel and controlunit is reduced through collapsing multiple commands of the channelprogram into a TCCB. The channel, e.g., channel 124 of FIG. 1, uses aTCW to identify the location of the TCCB, as well as locations foraccessing and storing status and data associated with executing thechannel program. The TCW is interpreted by the channel 124 and is notsent or seen by the control unit 110.

One example of a channel program to read 4 k of data, as in FIG. 2B, butincludes a TCCB, instead of separate individual CCWs, is described withreference to FIG. 4. As shown, a channel program 400, referred to hereinas a TCW channel program, includes a TCW 402 specifying a location inmemory of a TCCB 404, as well as a location in memory of a data area 406or a TIDAL 410 (i.e., a list of transport mode indirect data addresswords (TIDAWs), similar to MIDAWs) that points to data area 406, and astatus area 408.

The processing of a TCW channel program is described with reference toFIG. 5. The link protocol used for these communications is, forinstance, Fibre Channel Protocol (FCP). In particular, three phases ofthe FCP link protocol are used, allowing host bus adapters to be usedthat support FCP to perform data transfers controlled by CCWs. FCP andits phases are described further in “Information Technology—FibreChannel Protocol for SCSI, Third Version (FCP-3),” T10 Project 1560-D,Revision 4, Sep. 13, 2005, which is hereby incorporated herein byreference in its entirety.

The FCP defines the following terms, as recited in “InformationTechnology—Fibre Channel Protocol for SCSI, Third Version (FCP-3)”,pages 3-5:

N_Port: A hardware entity that supports the FC-FS-2 FC-2 layer. It mayact as an Originator, a Responder, or both;

Originator: The logical function associated with an N_Port responsiblefor originating an Exchange;

Responder: The logical function in an N_Port responsible for supportingthe Exchange initiated by the Originator in another N_Port;

Exchange: The basic mechanism that transfers information consisting ofone or more related nonconcurrent Sequences that may flow in the same oropposite directions. The Exchange is identified by an OriginatorExchange_ID (OX_ID) and a Responder Exchange_Identifier (RX_ID);Sequence: A set of one or more Data frames with a common Sequence_ID(SEQ_ID), transmitted unidirectionally from one N_Port to another N_Portwith a corresponding response, if applicable, transmitted in response toeach Data frame; andFCP_Port: An N_Port or NL_Port that supports the SCSI Fibre ChannelProtocol.

Fibre Channel (FC) is logically a point-to-point serial data channel.The Fibre Channel Physical layer (FC-2 layer) described by FC-FS-2performs those functions required to transfer data from one N_Port orNL_Port to another. An FC-4 mapping layer uses the services provided byFC-FS-2 to perform the functions defined by the FC-4. The protocol isdescribed in terms of the stream of FC IUs and Exchanges generated by apair of FCP_Ports that support the FC-4. The I/O operation defined bySAM-3 is mapped into a Fibre Channel Exchange. A Fibre Channel Exchangecarrying information for a SCSI I/O operation is an FCP Exchange. Therequest and response primitives of an I/O operation are mapped intoInformation Units (IUs) as shown in table 1.

TABLE 1 SCSI and Fibre Channel Protocol functions SCSI function FCPequivalent I/O operation Exchange Protocol Service request and responseSequence Send SCSI Command request Unsolicited command IU (FCP_CMND)Data delivery request Data descriptor IU (FCP_XFER_RDY) Data deliveryaction Solicited data IU (FCP_DATA) Send Command Complete responseCommand status IU (FCP_RSP) REQ/ACK for Command Complete Confirmation IU(FCP_CONF)

An application client begins an FCP I/O operation when it invokes a SendSCSI Command SCSI transport protocol service request or a Send TaskManagement Request SCSI transport protocol service request (see SAM-3).The Send SCSI Command SCSI transport protocol service request conveys asingle request or a list of linked requests from the application clientto the FCP service delivery subsystem. Each request contains all theinformation necessary for the processing of one SCSI command or taskmanagement function, including the local storage address andcharacteristics of data. The Fibre Channel Protocol then performs thefollowing actions using FC-FS-2 services to perform the SCSI command ortask management function. (FCP-3, p. 10)

The FCP_Port that is the initiator for the command starts an Exchange bysending an unsolicited command IU containing the FCP_CMND IU payload,including some command controls, addressing information, and the SCSIcommand descriptor block (CDB). The initiator FCP_Port sends theFCP_CMND IU payload to invoke the Send SCSI Command SCSI transportprotocol service request (see SAM-3) and start the FCP I/O operation.The Exchange that is started is identified by its fully qualifiedexchange identifier (FQXID) during the remainder of the FCP I/Ooperation and is used only for the IUs associated with that FCP I/Ooperation. (FCP-3, p. 10)

After all the data has been transferred, the device server transmits theSend Command Complete protocol service response (described in SAM-3) byrequesting the transmission of an IU containing the FCP_RSP IU payload.That payload contains the SCSI status and, if the SCSI status is CHECKCONDITION, the autosense data describing the condition. The FCP_RSP IUindicates completion of the SCSI command. If no command linking, errorrecovery, or confirmed completion is requested, the FCP_RSP IU is thefinal sequence of the Exchange. The device server determines whetheradditional linked commands are to be performed in the FCP I/O operation.If this is the last or only command processed in the FCP I/O operation,the FCP I/O operation and the Exchange are terminated. (FCP-3, p. 11)

Referring to FIG. 5, a channel 500 opens an exchange with a control unit502 and sends TCCB 504 to the control unit 502. In one example, the TCCB504 and sequence initiative are transferred to the control unit 502 in aFCP command, referred to as FCP_CMND information unit (IU) or atransport command IU. The control unit 502 executes the multiplecommands of the TCCB 504 (e.g., define extent command, locate recordcommand, read command as device control words (DCWs)) and forwards data506 to the channel 500 via, for instance, a FCP_Data IU. It alsoprovides status and closes the exchange 508. As one example, finalstatus is sent in a FCP status frame that has a bit active in, forinstance, byte 10 or 11 of the payload of a FCP_RSP IU, also referred toas a transport response IU. The FCP_RSP_IU payload may be used totransport FICON ending status along with additional status information.

In a further example, to write 4 k of customer data, the channel 500uses the FCP link protocol phases, as follows:

1. Transfer a TCCB in the FCP_CMND IU.

2. Transfer the IU of data, and sequence initiative to the control unit502. (FCP Transfer Ready Disabled).

3. Final status is sent in a FCP status frame that has a bit active in,for instance, byte 10 or 11 of the FCP_RSP IU Payload. The FCP_RES_INFOfield or sense field is used to transport FICON ending status along withadditional status information.

By executing the TCW channel program of FIG. 4, there is only oneexchange opened and closed (see also FIG. 5), instead of two exchangesfor the CCW channel program of FIG. 2B (see also FIG. 3). Further, forthe TCW channel program, there are three communication sequences (seeFIGS. 4-5), as compared to seven sequences for the CCW channel program(see FIGS. 2B-3).

The number of exchanges and sequences remain the same for a TCW channelprogram, even if additional commands are added to the program. Compare,for example, the communications of the CCW channel program of FIG. 6with the communications of the TCW channel program of FIG. 7. In the CCWchannel program of FIG. 6, each of the commands (e.g., define extentcommand 600, locate record command 601, read command 602, read command604, read command 606, locate record command 607 and read command 608)are sent in separate sequences from channel 610 to control unit 612.Further, each 4 k block of data (e.g., data 614-620) is sent in separatesequences from the control unit 612 to the channel 610. This CCW channelprogram requires two exchanges to be opened and closed (e.g., openexchanges 622, 624 and close exchanges 626, 628), and fourteencommunications sequences. This is compared to the three sequences andone exchange for the TCW channel program of FIG. 7, which accomplishesthe same task as the CCW channel program of FIG. 6.

As depicted in FIG. 7, a channel 700 opens an exchange with a controlunit 702 and sends a TCCB 704 to the control unit 702. The TCCB 704includes the define extent command, the two locate record commands, andthe four read commands in DCWs, as described above. In response toreceiving the TCCB 704, the control unit 702 executes the commands andsends, in a single sequence, the 16 k of data 706 to the channel 700.Additionally, the control unit 702 provides status to the channel 700and closes the exchange 708. Thus, the TCW channel program requires muchfewer communications to transfer the same amount of data as the CCWchannel program of FIG. 6.

Turning now to FIG. 8, one embodiment of the channel 124 in the channelsubsystem 108 and the control unit 110 and the channel 124 of FIG. 1that support TCW channel program execution are depicted in greaterdetail. The control unit 110 includes CU control logic 802 to parse andprocess command messages containing a TCCB, such as the TCCB 704 of FIG.7, received from the channel 124 via the connection 120. The CU controllogic 802 can extract DCWs and control data from the TCCB received atthe control unit 110 to control a device, for instance, I/O device 112via connection 126. The CU control logic 802 sends device commands anddata to the I/O device 112, and receives status information and otherfeedback from the I/O device 112. For example, the I/O device 112 may bebusy because of a previous reservation request targeting I/O device 112.To manage potential device reservation contention issues that can arisewhen the control unit 110 receives multiple requests to access the sameI/O device 112, the CU control logic 802 keeps track of and storesdevice busy messages and associated data in a device busy queue 804. Inan exemplary embodiment, an OS 103 of FIG. 1 reserves I/O device 112 tokeep other OSs 103 from accessing the I/O device 112 while thereservation is active. Although device reservation is not required forall I/O operations, device reservation can be used to support operationsthat necessitate exclusive access for a fixed duration of time, e.g.,disk formatting.

The control unit 110 may further include other buffer or memory elements(not depicted) to store multiple messages or status informationassociated with communications between the channel 124 and the I/Odevice 112. For example, a register located on the control unit 110 mayinclude a maximum control unit exchange parameter that defines themaximum number of open control unit exchanges that the control unit 110supports.

The channel 124 in the channel subsystem 108 includes multiple elementsto support communication with the control unit 110. In an exemplaryembodiment, the CHN control logic 806 controls communication between thechannel subsystem 108 and the control unit 110. The CHN control logic806 may directly interface to the CU control logic 802 via theconnection 120 to send commands and receive responses, such as transportcommand and response IUs. Alternatively, messaging interfaces and/orbuffers (not depicted) can be placed between the CHN control logic 806and the CU control logic 802.

An exemplary embodiment of a transport control word (TCW) 900 isdepicted in FIG. 9. The TCW 900 is utilized by the channel 124 to set upthe I/O operation and is not sent to the control unit 110. The TCWdepicted in FIG. 9 provides for both input and output data within asingle I/O operation.

In an exemplary TCW 900 depicted in FIG. 9, a format field 902 equal to“00b” indicates that what follows is a TCW 900. The TCW 900 alsoincludes reserved bits 904 for possible future use.

The TCW 900 also includes a flags field 906. The first five bits of theflags field 906 are reserved for future use and are set to zero. Thesixth bit of the flags field 906 is a TIDAL read flag. In an exemplaryembodiment, the TIDAL read flag is set to one when the input-dataaddress field 918 contains an address of a TIDAL. If the TIDAL read flagis set to zero, then the input-data address field 918 contains a dataaddress. The seventh bit of the flags field 906 is a TCCB TIDAL flag. Inan exemplary embodiment, the TCCB TIDAL flag is set to one when the TCCBaddress field 922 contains an address of a TIDAL. If the TCCB TIDAL flagis set to zero, then the TCCB address field 922 directly addresses theTCCB. The TCCB TIDAL flag allows the operating system software or thehyper-visor to layer function and prefix user channel programs. Theeighth bit of the flags field 906 is a TIDAL write flag. In an exemplaryembodiment, the TIDAL write flag is set to one when the output-dataaddress field 916 contains an address of a TIDAL. If the TIDAL writeflag is set to zero, then the output-data address field 916 contains adata address.

The ninth through twenty-forth bits of the flags field 906 are reservedfor future use.

The TCW 900 also includes a TCCB length field 910 which indirectlyrepresents the length of the TCCB and may be utilized to determine theactual length of the TCCB.

The read/write bits 912 in the TCW 900 are utilized to indicate whetherdata is being read and/or written as a result of executing the TCW 900.In an exemplary embodiment, the read bit in the read/write 912 bits isset to one to indicate that input data is being transferred from an I/Odevice 112 to system storage (e.g., main memory 102) in the host system101 as a result of executing the TCW 900. The write bit in theread/write bits 912 is set to one to indicate that output data is beingtransferred from system storage (e.g., main memory 102) in the hostsystem 101 to an I/O device as a result of executing the TCW 900.

The output-data address field 916 includes the address for the outputdata (if any). As described previously, the contents of the output-dataaddress field 916 may be an address of a TIDAL for output data (e.g., anindirect address) or the actual address of the output data (e.g., adirect address). The input-data address field 918 includes the addressfor the input data (if any). As described previously, the contents ofthe input-data address field 918 may be an address of a TIDAL for inputdata or the actual address of the input data. In an exemplaryembodiment, the output-data address field 916 and the input data addressfield 918 are implemented as sixty-four bit addresses.

The TCW 900 also includes a transport-status-block address field 920. Aportion (e.g., the extended status part) of a completion status in atransport response IU for an I/O operation is stored at this address.The TCCB address field 922 in the TCW 900 includes an address where theTCCB is located in system storage. As described previously, the TCCB isthe control block where the DCWs to be executed for the TCW 900 reside.Also as described previously, the contents of the TCCB address field 922may be an address of a TIDAL for the TCCB or the actual address of theTCCB. In an exemplary embodiment, the transport-status-block addressfield 920 and the TCCB address field 922 are implemented as sixty-fourbit addresses.

The output count field 924 in the TCW 900 indicates the amount of outputdata to be transferred by the TCW/TCCB for an output operation. In anexemplary embodiment, the output count field 924 specifies the number ofbytes in the output storage area designed by the TCW (the output-dataaddress 916) to be transferred. The input count field 926 in the TCW 900indicates the amount of input data to be transferred by the TCW/TCCB foran input operation. In an exemplary embodiment, the input count field926 specifies the number of bytes in the output storage area designed bythe TCW (the input-data address 918) to be transferred. Severaladditional fields in the TCW 900 are reserved: reserved field 928,reserved field 930 and reserved field 932. The interrogate-TCW addressfield 934 contains the address of another TCW and is used by the channel124 to interrogate that state of an operation under the initiative of acancel sub-channel I/O instruction.

The TCW depicted in FIG. 9 is one example of how a command word can beconfigured. Other configurations are possible where additional fieldsare included and/or fields depicted in FIG. 9 are not included.

FIG. 10 depicts one embodiment of a TCW channel program, in accordancewith an aspect of the present invention when both input and output datais included in a single I/O operation. As shown in FIG. 10, a TCWchannel program 1000 includes a TCW 1002 specifying a location in memoryof a TCCB 1004, a location in memory for storing input data 1006 or aTIDAL 1010 (i.e., a list of transport mode indirect data address words(TIDAWs) that points to the location for the input data 1006, a locationin memory of an output data area 1014 or a TIDAL 1012 that points to theoutput data area 1006, and a status area 1008.

The processing of the TCW channel program 1000 depicted in FIG. 10 isdescribed with reference to FIG. 11. Referring to FIG. 11, a channel1100 opens an exchange with a control unit 1102 and sends a TCCB 1104and output data 1105 located at the output data area 1014 specified bythe TCW 1002 to the control unit 1102. The channel 1100 determines howmuch data to send based on the value of the output count 924 in the TCW1002. The control unit 1102 executes the multiple commands of the TCCB1104 (e.g., define extent command, locate record command, write commandand read command as device control words (DCWs)) receives the outputdata 1105 from the channel 1100 and forwards input data 1106 per thedata count in the DCW to the channel 1100 via, for instance, a FCP_DataIU. The channel 1100 stores the input data 1106 at the locationspecified by the TCW 1002. The control unit 1102 also provides statusand closes the exchange 1108. In this manner, data is input to thechannel 110 and output to the control unit 1102 in a single TCW channelprogram 1000 (or I/O operation).

FIG. 12 depicts one embodiment of a process for bi-directional datatransfer within a single I/O operation, in accordance with an aspect ofthe present invention. In an exemplary embodiment, the processingdepicted in FIG. 12 occurs at a host computer system that is in networkcommunication with a control unit. The host computer system may includean I/O processing system that executes the process. Additionally, theI/O processing system may include a channel subsystem that executes theprocess. At block 1202, a TCW is obtained by the host computer. In anexemplary embodiment, the TCW is obtained (or received) from anoperating system running on the host computer. The TCW includes both anoutput data address 916 and output count field 924, and an input dataaddress 918 and input data count field 926. In an exemplary embodiment,the TCW includes output data when the write bit in the read/write bits912 is set to one and the TCW includes input data when the read bit inthe read/write bits 912 is set to one. At block 1204 the TCCB locationspecified by the TCW 922 is fetched and forwarded to the control unit.The TCCB contains the DCWs that inform the control unit what I/Ooperations to execute.

At block 1206, the output data is gathered from the location specifiedby the TCW (if the write bit in the read/write bits 912 is set to one).The amount of data gathered to be included in the output data is basedon the value of the output data count field 924. As describedpreviously, the output data address may be a direct address of theoutput data or an indirect address of the output data. An indirectaddress refers to an address containing a list of one or more addresses(e.g., a TIDAL) that point to a plurality of storage locations thatcollectively make up the output data. A direct address refers to anaddress containing the output data. In an exemplary embodiment, theTIDAL write flag in the flags field 906 in the TCW is set to one whenthe output-data address field 916 contains an address of a TIDAL, andset to zero when the output-data address field 916 contains the addressof the output data.

At block 1208, the output data is forwarded to the control unit. Forthis example XFER_RDY is disabled.

At block 1210, input data is received from the control unit as a resultof executing the I/O operation. At block 1212, the input data is storedat the location specified by the TCW (the input-data address 918). In anexemplary embodiment, the TCW includes input data when the read bit inthe read/write bits 912 is set to one. As described previously, theinput data-address 918 may be a direct address for storing the inputdata, or alternatively it may be an address to a list of addresses(e.g., a TIDAL or indirect address) that point to a plurality of storagelocations, each storing portions of the input data. In an exemplaryembodiment, the TIDAL read flag in the flags field 906 in the TCW is setto one when the input-data address field 918 contains an address of aTIDAL, and set to zero when the input-data address field 918 containsthe address of the input data.

Technical effects of exemplary embodiments include the ability toinclude both input and output data in a single I/O operation. Thisprovides flexibility in grouping DCWs and may lead to a decrease in thenumber of exchanges required between a channel and a control unit.

As described above, embodiments can be embodied in the form ofcomputer-implemented processes and apparatuses for practicing thoseprocesses. In exemplary embodiments, the invention is embodied incomputer program code executed by one or more network elements.Embodiments include a computer program product 1300 as depicted in FIG.13 on a computer usable medium 1302 with computer program code logic1304 containing instructions embodied in tangible media as an article ofmanufacture. Exemplary articles of manufacture for computer usablemedium 1302 may include floppy diskettes, CD-ROMs, hard drives,universal serial bus (USB) flash drives, or any other computer-readablestorage medium, wherein, when the computer program code logic 1304 isloaded into and executed by a computer, the computer becomes anapparatus for practicing the invention. Embodiments include computerprogram code logic 1304, for example, whether stored in a storagemedium, loaded into and/or executed by a computer, or transmitted oversome transmission medium, such as over electrical wiring or cabling,through fiber optics, or via electromagnetic radiation, wherein, whenthe computer program code logic 1304 is loaded into and executed by acomputer, the computer becomes an apparatus for practicing theinvention. When implemented on a general-purpose microprocessor, thecomputer program code logic 1304 segments configure the microprocessorto create specific logic circuits.

While the invention has been described with reference to exemplaryembodiments, it will be understood by those skilled in the art thatvarious changes may be made and equivalents may be substituted forelements thereof without departing from the scope of the invention. Inaddition, many modifications may be made to adapt a particular situationor material to the teachings of the invention without departing from theessential scope thereof. Therefore, it is intended that the inventionnot be limited to the particular embodiment disclosed as the best modecontemplated for carrying out this invention, but that the inventionwill include all embodiments falling within the scope of the appendedclaims. Moreover, the use of the terms first, second, etc. do not denoteany order or importance, but rather the terms first, second, etc. areused to distinguish one element from another. Furthermore, the use ofthe terms a, an, etc. do not denote a limitation of quantity, but ratherdenote the presence of at least one of the referenced item.

The invention claimed is:
 1. A computer program product for facilitatinginput/output (I/O) processing for an I/O operation at a control unitcoupled to an I/O device, the control unit configured for communicationwith a host computer system including a memory associated with anoperating system, the host computer system including a channelsubsystem, the computer program product comprising: a non-transitorytangible storage medium readable by a processing circuit and storinginstructions for execution by the processing circuit for performing amethod comprising: receiving, by the control unit, a command blocktransmitted from the channel subsystem as a single entity configured tohold a plurality of commands, the plurality of commands including atleast one of an input command and an output command, the plurality ofcommands specified by a transport command word (TCW) obtained by thechannel subsystem and associated with the I/O operation, the TCWspecifying at least one of a location in the memory of output data and alocation in the memory for storing input data, the TCW including a readindicator configured to indicate whether the I/O operation includesinput data and a write indictor configured to indicate whether the I/Ooperation includes output data; based on the command block holding atleast one output command, receiving the output data specified by the TCWand executing the at least one output command; and based on the commandblock holding at least one input command, forwarding the input dataspecified by the TCW to the channel subsystem for storage at a locationspecified by the TCW.
 2. The computer program product of claim 1,wherein the read indicator and the write indicator are each stored as abit in a field of the TCW.
 3. The computer program product of claim 1,wherein the TCW is obtained from a host operating system and specifiesall of the commands to be executed in a single I/O operation.
 4. Thecomputer program product of claim 1, wherein the method furthercomprises: opening an exchange with the channel subsystem in response toreceiving the command block; performing the forwarding in the openedexchange; and sending a status indication to the channel subsystem andclosing the opened exchange.
 5. The computer program product of claim 4,wherein the exchange is a mechanism for transferring information betweenthe channel subsystem and the control unit, the exchange being openedand used only for information transfers associated with the I/Ooperation specified in the TCW.
 6. The computer program product of claim1, wherein the TCW specifies a location in memory of a transport commandcontrol block (TCCB) configured to hold the plurality of commands, andreceiving the command block includes receiving the TCCB from the channelsubsystem.
 7. The computer program product of claim 1, wherein the TCWincludes an output-address field configured to specify the location ofthe output data, an output count field configured to indicate an amountof the output data, an input-address field configured to specify thelocation for storing the input data, and an input count field configuredto indicate an amount of the input data.
 8. An apparatus for providingbi-directional data transfer within a single input/output (I/O)operation, comprising: a control unit coupled to an I/O device, thecontrol unit configured for communication with a host computer systemincluding a memory associated with an operating system, the hostcomputer system including a channel subsystem configured to communicatewith the control unit, the control unit configured to perform a methodcomprising: receiving a command block transmitted from the channelsubsystem as a single entity configured to hold a plurality of commands,the plurality of commands including at least one of an input command andan output command, the plurality of commands specified by a transportcommand word (TCW) obtained by the channel subsystem and associated withthe I/O operation, the TCW specifying at least one of a location in thememory of output data and a location in the memory for storing inputdata, the TCW including a read indicator configured to indicate whetherthe I/O operation includes input data and a write indictor configured toindicate whether the I/O operation includes output data; based on thecommand block holding at least one output command, receiving the outputdata specified by the TCW and executing the at least one output command;and based on the command block holding at least one input command,forwarding the input data specified by the TCW to the channel subsystemfor storage at a location specified by the TCW.
 9. The apparatus ofclaim 8, wherein the TCW further specifies a size of the input data, andforwarding the input data is responsive to the size of the input data.10. The apparatus of claim 8, wherein the TCW is obtained from a hostoperating system and specifies all of the commands to be executed in asingle I/O operation.
 11. The apparatus of claim 8, wherein the methodfurther comprises: opening an exchange with the channel subsystem inresponse to receiving the command block; performing the forwarding inthe opened exchange; and sending a status indication to the channelsubsystem and closing the opened exchange.
 12. The apparatus of claim11, wherein the exchange is a mechanism for transferring informationbetween the channel subsystem and the control unit, the exchange beingopened and used only for information transfers associated with the I/Ooperation specified in the TCW.
 13. The apparatus of claim 8, whereinthe TCW specifies a location in memory of a transport command controlblock (TCCB) configured to hold the plurality of commands, and receivingthe command block includes receiving the TCCB from the channelsubsystem.
 14. The apparatus of claim 8, wherein the TCW includes anoutput-address field configured to specify the location of the outputdata, an output count field configured to indicate an amount of theoutput data, an input-address field configured to specify the locationfor storing the input data, and an input count field configured toindicate an amount of the input data.
 15. A method of facilitatinginput/output (I/O) processing for an I/O operation at a control unitcoupled to an I/O device, the control unit configured for communicationwith a host computer system including a memory associated with anoperating system, the host computer system including a channelsubsystem, the method comprising: receiving a command block transmittedfrom the channel subsystem as a single entity configured to hold aplurality of commands, the plurality of commands including at least oneof an input command and an output command, the plurality of commandsspecified by a transport command word (TCW) obtained by the channelsubsystem and associated with the I/O operation, the TCW specifying atleast one of a location in the memory of output data and a location inthe memory for storing input data, the TCW including a read indicatorconfigured to indicate whether the I/O operation includes input data anda write indictor configured to indicate whether the I/O operationincludes output data; based on the command block holding at least oneoutput command, receiving the output data specified by the TCW andexecuting the at least one output command; and based on the commandblock holding at least one input command, forwarding the input dataspecified by the TCW to the channel subsystem for storage at a locationspecified by the TCW.
 16. The method of claim 15, wherein the TCWfurther specifies a size of the input data, and forwarding the inputdata is responsive to the size of the input data.
 17. The method ofclaim 15, further comprising: opening an exchange with the channelsubsystem in response to receiving the command block; performing theforwarding in the opened exchange; and sending a status indication tothe channel subsystem and closing the opened exchange.
 18. The method ofclaim 17, wherein the exchange is a mechanism for transferringinformation between the channel subsystem and the control unit, theexchange being opened and used only for information transfers associatedwith the I/O operation specified in the TCW.
 19. The method of claim 15,wherein the TCW specifies a location in memory of a transport commandcontrol block (TCCB) configured to hold the plurality of commands, andreceiving the command block includes receiving the TCCB from the channelsubsystem.
 20. The method of claim 15, wherein the TCW includes anoutput-address field configured to specify the location of the outputdata, an output count field configured to indicate an amount of theoutput data, an input-address field configured to specify the locationfor storing the input data, and an input count field configured toindicate an amount of the input data.